package com.ztc.beans;

import java.util.Date;
import java.util.Objects;

public class Jbook {
    private int id;
    private int bid;
    private int uid;
    private Date jdate;
    private Date hdate;
    private User user;
    private Book book;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getBid() {
        return bid;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public Date getJdate() {
        return jdate;
    }

    public void setJdate(Date jdate) {
        this.jdate = jdate;
    }

    public Date getHdate() {
        return hdate;
    }

    public void setHdate(Date hdate) {
        this.hdate = hdate;
    }

    public Jbook(int id, int bid, int uid, Date jdate, Date hdate) {
        this(bid,uid,jdate,hdate);
        this.id = id;
    }
    public Jbook(int bid, int uid, Date jdate, Date hdate) {
        this.bid = bid;
        this.uid = uid;
        this.jdate = jdate;
        this.hdate = hdate;
    }
    public Jbook(){
    }

    @Override
    public String toString() {
        return "Jbook{" +
                "id=" + id +
                ", bid=" + bid +
                ", uid=" + uid +
                ", jdate=" + jdate +
                ", hdate=" + hdate +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        Jbook jbook = (Jbook) o;
        return id == jbook.id && bid == jbook.bid && uid == jbook.uid && Objects.equals(jdate, jbook.jdate) && Objects.equals(hdate, jbook.hdate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, bid, uid, jdate, hdate);
    }
}
